package com.newmainsoftech.logging.wrapper;

import com.google.inject.Guice;
import com.google.inject.Injector;

public class LoggerWrapInjector implements LoggerWrapInjectorContract {
	private static LoggerWrapInjectionModule logWrapperInjectionModule = new LoggerWrapInjectionModule();
	
	private static Injector injector;
		public synchronized static Injector getInjector() {
			if ( LoggerWrapInjector.injector == null) {
				LoggerWrapInjector.injector = Guice.createInjector( logWrapperInjectionModule);
			}
			return LoggerWrapInjector.injector;
		}
		public synchronized static void setInjector( Injector injector) {
			LoggerWrapInjector.injector = injector;
		}
		
	public LoggerWrapContract getLoggerWrapper() {
		return LoggerWrapInjector.getInjector().getInstance( LoggerWrapContract.class);
	}
}
